import json
import logging
import os

from coin2.support.product_info.spot_upbit_v1 import convert_coin1_constants


pi_file = 'data/coin2/product_info/Spot.Upbit.v1.json'
with open(pi_file) as f:
  static_constants = convert_coin1_constants(json.load(f)['product_infos'])

dynamic_constants = {}
if int(os.getenv('USE_DYNAMIC_SYMBOL', 0)):
  try:
    from coin2.support.product_info.spot_upbit_v1 import gen_coin1_constants
    dynamic_constants = gen_coin1_constants()
  except Exception as e:
    logging.error('Failed to use upbit dynamic symbols! %s', e)

coin_list = list(set(
    ['BCC'] +
    static_constants.get('coin_list', []) +
    dynamic_constants.get('coin_list', [])))
fiat_list = ["KRW",]
currency_list = coin_list + fiat_list

active_currency_list = [
    'ADA',
    'BCHABC',
    'BCHSV',
    'BTC',
    'EOS',
    'ETC',
    'ETH',
    'IOTA',
    'LTC',
    'NEO',
    'OMG',
    'ONT',
    'QTUM',
    'TRX',
    'XRP'
]

native_symbol_list_for_test = [
    "KRW-BTC",
    "KRW-ETH",
]

native_symbol_crix_list_for_test = [
    "CRIX.UPBIT.KRW-BTC",
    "CRIX.UPBIT.KRW-ETH",
]
